resource.AddFile( "sound/weapons/hacks01.wav" )
resource.AddFile( "materials/weapons/haxicon.vmt" )
resource.AddFile( "materials/weapons/haxicon.vtf" )
resource.AddFile( "models/weapons/v_pfinger.mdl" )
resource.AddFile( "models/weapons/v_pfinger.vvd" )
resource.AddFile( "models/weapons/v_pfinger.dx80.vtx" )
resource.AddFile( "models/weapons/v_pfinger.dx90.vtx" )
resource.AddFile( "models/weapons/v_pfinger.sw.vtx" )


 SWEP.Author = "Kwigg, updated by NECROSSIN"; 
 SWEP.Contact = ""; 
 SWEP.Purpose = "Cheaters?"; 
 SWEP.Instructions = "Remember to turn on sv_cheats.";
 
 SWEP.Spawnable = false; 
 SWEP.AdminSpawnable = true; 
   
 SWEP.ViewModel = "models/Weapons/v_pfinger.mdl"; 
 SWEP.WorldModel = "models/props_lab/monitor01a.mdl";
 SWEP.ViewModelFOV = 95
  
   
 SWEP.Primary.ClipSize = -1; 
 SWEP.Primary.DefaultClip = -1; 
 SWEP.Primary.Automatic = false; 
 SWEP.Primary.Ammo = "none";
 
 
   
 local ShootSound = Sound ("weapons/hacks01.wav");
 local ShootSound2 = Sound ("weapons/iceaxe/iceaxe_swing1.wav");
 local ScoutSound = Sound ("vo/scout_jeers04.wav");
 
 function SWEP:Deploy()
	self.Owner:DrawViewModel(false)
	self.Owner:DrawWorldModel(false)
end 

  
 function SWEP:Reload() 

 end 
 
 function SWEP:Initialize()
	self.ActivityTranslate = {}
	self.ActivityTranslate[ACT_HL2MP_IDLE] = ACT_HL2MP_IDLE_MELEE
	self.ActivityTranslate[ACT_HL2MP_WALK] = ACT_HL2MP_WALK_MELEE
	self.ActivityTranslate[ACT_HL2MP_RUN] = ACT_HL2MP_RUN_MELEE
	self.ActivityTranslate[ACT_HL2MP_IDLE_CROUCH] = ACT_HL2MP_IDLE_MELEE
	self.ActivityTranslate[ACT_HL2MP_WALK_CROUCH] = ACT_HL2MP_WALK_CROUCH_MELEE
	self.ActivityTranslate[ACT_HL2MP_GESTURE_RANGE_ATTACK] = ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE
	self.ActivityTranslate[ACT_HL2MP_GESTURE_RELOAD] = ACT_HL2MP_GESTURE_RELOAD_MELEE
	self.ActivityTranslate[ACT_HL2MP_JUMP] = ACT_HL2MP_JUMP_MELEE
	self.ActivityTranslate[ACT_RANGE_ATTACK1] = ACT_RANGE_ATTACK_MELEE
end 
   
 function SWEP:Think() 
 end 
   
 function SWEP:throw_attack()
 
  
 
 if (SERVER) then
	self.Weapon:EmitSound (ShootSound2);
	self.Owner:SetAnimation(PLAYER_ATTACK1)
		self.Monitor = ents.Create("monitor")
		self.Monitor:SetPos(self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
		self.Monitor:SetAngles( self.Owner:EyeAngles() )
		self.Monitor:SetPhysicsAttacker(self.Owner)
		self.Monitor:SetOwner(self.Owner)
		self.Monitor:Spawn()
		
		local phys = self.Monitor:GetPhysicsObject(); 
		local tr = self.Owner:GetEyeTrace();
		local PlayerPos = self.Owner:GetShootPos()
 	 
 	local shot_length = tr.HitPos:Length(); 
 	phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() *  math.pow(shot_length, 3));
	phys:ApplyForceOffset(VectorRand()*math.Rand(10000,30000),PlayerPos + VectorRand()*math.Rand(0.5,1.5))

	end

 end
   
 function SWEP:PrimaryAttack() 
 
    self.Weapon:EmitSound (ShootSound);
	self.Owner:DrawViewModel(true)
	self.Weapon:SetNextPrimaryFire( CurTime() + 5 )
 	timer.Create("HAX", 1.01, 1, function()
	self.Owner:DrawViewModel(false)
	self:throw_attack() 
	end )
	timer.Simple(1.02, game.ConsoleCommand, "host_timescale 0.03\n")
    timer.Simple(1.03, game.ConsoleCommand, "pp_motionblur 1\n")
    timer.Simple(1.3, game.ConsoleCommand, "pp_motionblur 0\n")
    timer.Simple(1.3, game.ConsoleCommand, "host_timescale 1\n")
end

function SWEP:SecondaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + 4 )
local tr = self.Owner:GetEyeTrace();
if tr.Entity:IsNPC() or tr.Entity:IsPlayer() then
tr.Entity:EmitSound (ScoutSound)
end
end